import request from '@/utils/request';
import { PageResponse } from '@/interface/pages';

/**
 * 获取分页列表
 *
 * @returns Promise
 *
 * @todo 发起axios请求
 */
export const getRechargeList = (params: API.userRecharge.PageListDto) => {
  return request<PageResponse<API.userRecharge.EntitySchema[]>>({
    url: '/admin/recharge',
    method: 'get',
    params
  });
};

/**
 * 创建
 *
 * @returns Promise
 *
 * @todo 发起axios请求
 */
export const createRecharge = (data: API.userRecharge.EntityDto) => {
  return request({
    url: `/admin/recharge`,
    method: 'post',
    data
  });
};
